<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />  
    <title>API分类</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta name="author" content="飞啊飘啊">
	<meta name="hashcode" content="1463018633">
	
	<script>window.duteTag="lz";</script>
	<script type="text/javascript" src="/admin/js/dute-1.0.js"></script>
	<script type="text/javascript" src="/admin/js/jquery-1.7.1.min.js"></script>
	
	<script type="text/javascript" src="/admin/js/lazy3q.ui.js"></script>
	<script>
		document.write('<link rel="stylesheet" type="text/css" href="/admin//css/'+($.cookie('theme')||'elegant')+'/lazy3q.ui.css" /> ');
	</script>
	
	<script type="text/javascript" src="/admin/js/jquery-ui-1.10.2.custom.min.js"></script>
	
	<!-- 用户自定义js(懒加载) -->
	<script type="text/javascript" src="/admin/js/define.js"></script>
	<!-- 用户自定义css样式 -->
	<link rel="stylesheet" type="text/css" href="/admin/css/define.css"/>
	<!-- icon font -->
  	<link rel="stylesheet" href="/admin/css/iconfont.css">
	
	
	
	<script type="text/javascript">
		window.basePath="/";
		window.hashcode = "1463018633";
	</script>
		
	<!-- 感谢kindeditor出品的在线HTML编辑控件 -->
	<script type="text/javascript" charset="utf-8" src="/admin/js/kindeditor/kindeditor.js"></script>
		
	<!-- 感谢My97DatePicker出品的时间控件 -->
	<script language="javascript" type="text/javascript" src="/admin/js/My97DatePicker/WdatePicker.js"></script>
	
	<!------------------------VIEW_HTML_HEAD------------------------>
	<!------------------------VIEW_HTML_HEAD------------------------>	
	
</head>
<script>
Page({
  data:{
    
  },
  onLoad: function(options) {
  	var THIS = this;
  	THIS.setData(options);
  	$.getAjax("apitype.get.do",options,function(protocol){
  		if(protocol.message){
  			$.toast(protocol.message);
  		}
  		document.title={
  			 "insert":"创建API分类"
  			,"inport":"导入API分类"
  			,"update":"修改API分类"
  			,"detail":"API分类详情"
  		}[options.edittype];
  		THIS.setData(protocol.data); 
  		/******************VIEW_HTML_SET_DATA******************/
  		/******************VIEW_HTML_SET_DATA******************/
  	});
  }
});
</script>
<script>
window["lzFlashUrl"]=top.lzFlashUrl||"/admin/flash/";
window["uploadUrl"]=top.uploadUrl||"/admin/upload.do";

$(function(){
		 
	$("#apitypeForm").form({
		"":function(){}
		,"srvApiType.satId":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
			}
		}
		,"srvApiType.satName":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "分类名称不能为空";
			}
		}
		,"srvApiType.satParent":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
			}
		}
		,"srvApiType.satFlag":function(el){
			if(el.value.length>32 && el.value.indexOf("[*]")==-1)
				return "分类标识最大长度为32个字符";
		}
		,"srvApiType.satUpdateTime":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "修改时间不能为空";
			}
		}
		,"srvApiType.satAddTime":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "添加时间不能为空";
			}
		}
		,"srvApiType.satStatus":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "请选择状态";
			}
		}
	},function(){
		/******************************LAZY3Q_FORM_VALIDATE******************************/
		/******************************LAZY3Q_FORM_VALIDATE******************************/
	});		
});
</script>

<body style="display:none;">



<!------------------------VIEW_HTML_TOP------------------------>
<!------------------------VIEW_HTML_TOP------------------------>


<form enctype="{{inports!=null?'multipart/form-data':''}}" lz:if="{{edittype=='insert'||edittype=='update'||edittype=='detail'||edittype=='any'||edittype=='inport'}}" class="form editform edittype_{{edittype}}" ref="SrvApiType" id="apitypeForm" name="apitypeForm" target="jsoniframe" action="apitype.{{edittype=='any'?'update':edittype}}.do" method="post">
	<div class="head"></div>
	<div class="body">
		<div class="content">
			<div lz:if="{{edittype!='detail'}}" class="prompt">
				温馨提示：请仔细填写API分类相关信息，<span class="extrude">"*" 为必填选项。</span>
			</div>
			<br/>
			<lz:block lz:if="{{message}}">
			<br/>
			<center>
				<font color="red"><h4>{{message}}</h4></font>
			</center>
			<br/>
			</lz:block>
			<input type="hidden" value="{{complete}}" name="complete" id="complete" />
			<input type="hidden" value="{{ids}}" name="ids" id="ids" />
			<textarea name="PARAMS" id="PARAMS" style="display:none">{{PARAMS}}</textarea>
			
			
			<lz:block lz:if="{{inports}}">
			  <div class="line"></div>
			  <dl style="width:98%;">
			  	<dt>Excel文件:</dt>
			  	<dd>
			  		<input type="hidden" value="{{inports}}" name="inports" id="inports" />
			  		<input type="hidden" value="{{inport$}}" name="inport$" id="inport$" />
			  		<input name="file" name="file" type="file"/>
			  		<b>*</b>
			  		<div>
						请上传excel文件，表格列依次为：[{{inport$}}]，excel表格第一行为列名称，将不作为上传数据行
					</div>
			  	</dd>
			  </dl>
			  <div class="line"></div>
			</lz:block>
	{{lz.set("satId_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"satId"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"satId"))))}}
	{{lz.set("satId_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$satId}}
	<dl lz:if="{{satId_editable||satId_readonly}}" class="satId hidden " major  ref="satId">
		<dt>编　　号:</dt>
		<dd lz:if="{{satId_editable}}" input="hidden">
			<lz:block lz:if="{{srvApiType$satId}}">
				{{srvApiType$satId}}
			</lz:block>
			<lz:block lz:if="{{!srvApiType$satId}}">
			<input type="hidden" value="{{lz.htm(srvApiType.satId)}}" name="srvApiType.satId" id="satId" />
	 	 </lz:block>
	 	 
	 	 <em></em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{satId_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="satId">{{srvApiType.satId}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvApiType.satId$||srvApiType.satId)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$satId}}
	{{lz.set("satName_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"satName"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"satName"))))}}
	{{lz.set("satName_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$satName}}
	<dl lz:if="{{satName_editable||satName_readonly}}" class="satName  " major  ref="satName">
		<dt>分类名称:</dt>
		<dd lz:if="{{satName_editable}}" input="text">
			<lz:block lz:if="{{srvApiType$satName}}">
				{{srvApiType$satName}}
			</lz:block>
			<lz:block lz:if="{{!srvApiType$satName}}">
		 	<input type="text" class="input narrow"   name="srvApiType.satName" id="satName"  value="{{lz.htm(srvApiType.satName)}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请输入API分类的分类名称</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{satName_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="satName">{{srvApiType.satName}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvApiType.satName$||srvApiType.satName)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$satName}}
	{{lz.set("satParent_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"satParent"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"satParent"))))}}
	{{lz.set("satParent_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$satParent}}
	<dl lz:if="{{satParent_editable||satParent_readonly}}" class="satParent  " major  ref="satParent">
		<dt>所属分类:</dt>
		<dd lz:if="{{satParent_editable}}" input="label">
			<lz:block lz:if="{{srvApiType$satParent}}">
				{{srvApiType$satParent}}
			</lz:block>
			<lz:block lz:if="{{!srvApiType$satParent}}">
			<input type="hidden" name="srvApiType.satParent" id="srvApiType.satParent"  value="{{srvApiType.satParent||'0'}}"/>
			{{srvApiType.satParent$||srvApiType.satParent||"[无]"}}
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em></em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{satParent_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class="" name="srvApiType.satParent" style="display:none;" id="satParent">{{srvApiType.satParent}}</textarea>
		 		<span>
		 	
			 <a href="javascript:void(0);" onclick="window.href('/admin/api/apitype.details.html?key=srvApiType.satParent}')">
			 {{lz.html(srvApiType.satParent$||srvApiType.satParent)}}</a>
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$satParent}}
	{{lz.set("satFlag_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"satFlag"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"satFlag"))))}}
	{{lz.set("satFlag_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$satFlag}}
	<dl lz:if="{{satFlag_editable||satFlag_readonly}}" class="ribs satFlag  " major  ref="satFlag">
		<dt>分类标识:</dt>
		<dd lz:if="{{satFlag_editable}}" input="text">
			<lz:block lz:if="{{srvApiType$satFlag}}">
				{{srvApiType$satFlag}}
			</lz:block>
			<lz:block lz:if="{{!srvApiType$satFlag}}">
		 	<input type="text" class="input narrow"  maxlength="32" name="srvApiType.satFlag" id="satFlag"  value="{{lz.htm(srvApiType.satFlag)}}"/>
	 	 </lz:block>
	 	 
	 	 <em>请输入API分类的分类标识</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{satFlag_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="satFlag">{{srvApiType.satFlag}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvApiType.satFlag$||srvApiType.satFlag)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$satFlag}}
	{{lz.set("satUpdateTime_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"satUpdateTime"))))&&false)||(edittype=='update'&&false)||((edittype=='any')&&(lz.idin(fields,"satUpdateTime"))))}}
	{{lz.set("satUpdateTime_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$satUpdateTime}}
	<dl lz:if="{{satUpdateTime_editable||satUpdateTime_readonly}}" class="satUpdateTime  " major  ref="satUpdateTime">
		<dt>修改时间:</dt>
		<dd lz:if="{{satUpdateTime_editable}}" input="datetime">
			<lz:block lz:if="{{srvApiType$satUpdateTime}}">
				{{srvApiType$satUpdateTime}}
			</lz:block>
			<lz:block lz:if="{{!srvApiType$satUpdateTime}}">
		 	<input onchange="void(0);" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text" class="datetime input narrow" maxlength="19" name="srvApiType.satUpdateTime" id="satUpdateTime"  value="{{srvApiType.satUpdateTime$}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请选择API分类的修改时间</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{satUpdateTime_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="satUpdateTime">{{srvApiType.satUpdateTime}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvApiType.satUpdateTime$||srvApiType.satUpdateTime)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$satUpdateTime}}
	{{lz.set("satAddTime_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"satAddTime"))))&&false)||(edittype=='update'&&false)||((edittype=='any')&&(lz.idin(fields,"satAddTime"))))}}
	{{lz.set("satAddTime_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$satAddTime}}
	<dl lz:if="{{satAddTime_editable||satAddTime_readonly}}" class="satAddTime  " major  ref="satAddTime">
		<dt>添加时间:</dt>
		<dd lz:if="{{satAddTime_editable}}" input="datetime">
			<lz:block lz:if="{{srvApiType$satAddTime}}">
				{{srvApiType$satAddTime}}
			</lz:block>
			<lz:block lz:if="{{!srvApiType$satAddTime}}">
		 	<input onchange="void(0);" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text" class="datetime input narrow" maxlength="19" name="srvApiType.satAddTime" id="satAddTime"  value="{{srvApiType.satAddTime$}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请选择API分类的添加时间</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{satAddTime_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="satAddTime">{{srvApiType.satAddTime}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvApiType.satAddTime$||srvApiType.satAddTime)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$satAddTime}}
	{{lz.set("satStatus_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"satStatus"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"satStatus"))))}}
	{{lz.set("satStatus_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$satStatus}}
	<dl lz:if="{{satStatus_editable||satStatus_readonly}}" class="satStatus  " major  ref="satStatus">
		<dt>状　　态:</dt>
		<dd lz:if="{{satStatus_editable}}" input="select">
			<lz:block lz:if="{{srvApiType$satStatus}}">
				{{srvApiType$satStatus}}
			</lz:block>
			<lz:block lz:if="{{!srvApiType$satStatus}}">
		 	<select class="narrow" id="satStatus" name="srvApiType.satStatus">
		 		<option value="">请选择</option>
				<option value="1" selected='{{srvApiType.satStatus=="1"?"selected":""}}'>正常</option>
				<option value="0" selected='{{srvApiType.satStatus=="0"?"selected":""}}'>无效</option>
		 	</select>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请选择API分类的状态</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{satStatus_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="satStatus">{{srvApiType.satStatus}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvApiType.satStatus$||srvApiType.satStatus)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$satStatus}}
			
			
			<div class="line">
				<center lz:if="{{edittype=='insert'}}">
					<a onclick="$('.ribs').show();window.fireResize();$('.ribs-handle').toggle();" href="javascript:void(0);" class="state-content ribs-handle" style="display:inline;padding: 0px 15px;">点击展开更多编辑项</a>
					<a onclick="$('.ribs').hide();window.fireResize();$('.ribs-handle').toggle();" href="javascript:void(0);" class="state-content ribs-handle" style="display:none;padding: 0px 15px;">点击收起更多编辑项</a>
				</center>
			</div>
			<center class="buttons">
				<input type="hidden" value="{{srvApiType.satId}}" name="srvApiType.satId" id="satId" />
			
			<lz:block lz:if="{{edittype=='insert'||edittype=='update'||edittype=='any'||edittype=='inport'}}">
				<button class="button" type="submit">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-tick.png"/>
					<span class="iconB iconfont icon-weibiaoti8"></span>
					保存&nbsp;&nbsp;</button>
				<button title="不保存数据,关闭窗口,不刷新原列表" class="button" onclick="cancel();" type="button">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					关闭&nbsp;&nbsp;</button>
			</lz:block>
			
			<lz:block lz:if="{{edittype=='detail'}}">
				<button lz:if="{{canEdit}}" type="button" class="button" onclick='window.location.href="/admin/api/apitype.edit.html?edittype=update&id={{srvApiType.id}}"'>
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-tick.png"/>
					<span class="iconB iconfont icon-weibiaoti8"></span>
					修改&nbsp;&nbsp;</button>
				<button lz:if="{{canDel}}" type="button" class="button" onclick="deleteApitype('{{srvApiType.id}}','{{srvApiType.satName}}')">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					删除&nbsp;&nbsp;</button>
				<button title="不保存数据,关闭窗口,不刷新原列表" class="button" onclick="cancel();" type="button">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					关闭&nbsp;&nbsp;</button>
			</lz:block>
					
			</center>
			<br/>

		</div>
	</div>
	<div class="foot"></div>		
</form>

 


<!------------------------VIEW_HTML_BOTTOM------------------------>
<!------------------------VIEW_HTML_BOTTOM------------------------>


</body>

<!------------------------VIEW_HTML_FOOTER------------------------>
<!------------------------VIEW_HTML_FOOTER------------------------>
<script>
	
	$(function(){
		if(parent.setit){
			parent.setit("/admin/api/apitype.edit.html",document.title,"/admin//images/icons/20088256421631277807.png");
		}
	});
	
	function cancel(){
		if(parent.closeHref){
			parent.closeHref("/admin/api/apitype.edit.html");
		}else{
			$.closeModalDialog();
		}
	}


	/**
	* 删除API分类
	**/
	function deleteApitype(id,flag)
	{
		var dialog=top.$.dialog({
				html:"<span style='white-space:nowrap;'>确定要删除当前数据吗？</span>",
				title:"删除API分类",
				modal: true,			
				onOk:function(){
					dialog.closeDialog();
					var url = "/admin/api/apitype.delete.do";
					var params = {id:id};
					var protocol = $.getAjax(url,params);
					if(protocol.message){
						top.$.toast(protocol.message);
					}
					if(protocol.success){
						caller.location.href=caller.location.href;		
					}
				}
		 });	
	}
</script>
</html>